import request from './request'

// 获取指定ID的健康讲座
export const getHealthLectureApi = id => request.get(`/health-lectures/${id}`)

// 分页获取健康讲座列表
export const getHealthLecturesPageApi = (pageNum = 1, pageSize = 10, status, keyword) => request.get('/health-lectures/page', {
    params: { pageNum, pageSize, status, keyword }
})

// 创建健康讲座
export const createHealthLectureApi = data => request.post('/health-lectures', data)

// 更新健康讲座
export const updateHealthLectureApi = (id, data) => request.put(`/health-lectures/${id}`, data)

// 删除健康讲座
export const deleteHealthLectureApi = id => request.delete(`/health-lectures/${id}`)

// 点赞健康讲座
export const likeHealthLectureApi = id => request.post(`/health-lectures/${id}/like`)

// 获取即将开始的讲座
export const getUpcomingLecturesApi = (limit = 5) => request.get('/health-lectures/upcoming', {
    params: { limit }
})

// 获取正在进行的讲座
export const getOngoingLecturesApi = () => request.get('/health-lectures/ongoing')

// 获取已结束的讲座
export const getFinishedLecturesApi = (limit = 5) => request.get('/health-lectures/finished', {
    params: { limit }
})

// 获取讲座统计数据
export const getLectureStatisticsApi = () => request.get('/health-lectures/statistics') 